Static detection of vulnerabilities in base images of software containers

ABSTRACT

A system and method for detecting vulnerabilities in base images of software containers are disclosed. The method includes receiving an event indicating that at least one base image should be scanned for vulnerabilities, each base image including at least one image layer, wherein the event designates at least one source of the at least one base image, wherein the least one base image includes resources utilized to execute at least a software container; extracting contents of each image layer of each base image; scanning the extracting contents to detect at least one vulnerability; and generating a detection event, when the at least one vulnerability is detected.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority from U.S. Provisional PatentApplication No. 62/241,812 filed on Oct. 15, 2015, the contents of whichare hereby incorporated by reference.

TECHNICAL FIELD

The present disclosure generally relates to cybersecurity systems, andmore particularly to detection of malicious code and activity in imagesoftware containers.

BACKGROUND

A software container is an instance of a user-space running anapplication within the operating system (OS) of a host device (e.g., aserver). Software containers enable operating-system-levelvirtualization in which the OS kernel allows the existence of multipleisolated software containers.

A software container (also known as a container) provides an executableenvironment with a complete filesystem. The filesystem may contain code,runtime, system tools, system libraries, and so on. That is, executionof a software container can be the same regardless of the underlyinginfrastructure. A Docker is one of the popular existing platforms forcreating, migrating, managing, and deploying software containers.

A software container, unlike a virtual machine, does not require orinclude a separate operating system. Rather, the container relies on thekernel's functionality and uses hardware resources (CPU, memory, I/O,network, etc.) and separate namespaces to isolate the application's viewof the operating system. A software container can access the OS kernel'svirtualization features either directly or indirectly. For example,Linux® Kernel can be accessed directly using the libcontainer library orindirectly using the libvirt service.

As demonstrated in FIG. 1, a number of software containers (i.e., theapp containers 110-1 through 110-n, hereinafter referred to individuallyas a container 110, merely for simplicity purposes) can access and sharethe same OS kernel 120. However, each container 110 can be constrainedto only use a defined amount of hardware resources (e.g., CPU, memory,etc.) in the underlying hardware layer 130. Thus, using softwarecontainers, hardware resources can be isolated, services can berestricted, and processes can be provisioned to have an almostcompletely private view of the operating system with their own processID space, file system structure, and network interfaces.

FIG. 2 illustrates a typical structure of a software container 200. Thesoftware container 200 includes a base image 210 and a container layer220. The base image 210 includes one or more image layers 215-1 through215-q (hereinafter referred to individually as a layer 215 andcollectively as layers 215, merely for simplicity purposes). The layers215 are read-only layers that represent filesystem differences. That is,the layers 215 are stacked on top of each other to form a base for thecontainer's 200 root filesystem. The layers 215 are read only, and eachlayer 215 is identified by a randomly generated identifier number of achecksum computed using a hash function.

The base image 210 (and its layers 215) can be shared across differentsoftware containers. Thus, only the container layer 220, which is thetop layer, differentiates between one software container and another.The container layer 220 is a readable and writable layer where all datawritten to the software container 200 are saved in the container layer220. When the software container 200 is deleted, the writable containerlayer 220 is also deleted, and the base image 210 remains unchanged. Assuch, the multiple software containers 200 can share access to the samebase image 210, each of which has its own data state. In the exampledemonstrated in FIG. 2, the software container 200 is a Docker container(e.g., compliant with the Docker platform).

The popularity of software containers has been increased due to the easyintegration with cloud-computing platforms (e.g., Amazon® Web Services,Google® Cloud Platform, Microsoft® Azure, etc.). On such platforms,service providers can offer operating systems to run services andapplications. With that said, the increasing reliance on softwarecontainers increases the need for secured execution.

Base images are typically uploaded and stored in third-party imageregistries and usually are not operated directly by an organization.Further, the images are used across many containers. As such, images canbe developed and uploaded to image registries by programmers who areassociated with the organization seeking to use the image. Therefore,hackers can take advantage and program images to include malicious code,thus such images can be vulnerable when integrated in a softwarecontainer. Such malicious code may carry any type of malware including,for example, computer viruses, worms, Trojan horses, ransomware,spyware, adware, scareware, and the like. Further such malicious codemay be a source for an ATP attack or a distributed DoS (DDoS) attackwhen a software container is executed with an infected or maliciousimage.

Typically, a software container (and, thus, each application) can besecured separately from other software containers (and applications).Thus, one software container cannot access resources of other softwarecontainers. However, the isolation of software containers cannot preventthe execution of malicious code. Malicious activity by softwarecontainers can occur through exploitation of legitimate programs orservices in a container and improper configuration. Improperconfiguration may result in, for example, privilege escalations.Detection of such vulnerabilities occurs only at runtime, i.e., duringthe execution of the software containers.

To prevent integration of malicious images in a software container,detection of vulnerabilities in images should occur prior to theexecution of the software container. Preferably, such vulnerabilitiesshould be checked when images are uploaded to the image registries.

Existing security solutions are not designed to detect vulnerabilitiesin images of software containers. Specifically, images have a specificstructure that cannot be processed by existing security solutions. Forexample, a conventional antivirus tool cannot scan images to detectcomputer viruses, as such a tool cannot extract the different layers ofan image and cannot parse each layer to analyze its contents.

In addition, currently there is no security tool that can check forvulnerabilities in base images, as such images are uploaded to aregistry (e.g., during a continuous integration process). This is amajor drawback, as there is no defense preventing registries fromincluding malicious code embedded therein.

It would be therefore advantageous to provide a solution that wouldsecure base images of software containers and image registries.

SUMMARY

A summary of several example embodiments of the disclosure follows. Thissummary is provided for the convenience of the reader to provide a basicunderstanding of such embodiments and does not wholly define the breadthof the disclosure. This summary is not an extensive overview of allcontemplated embodiments, and is intended to neither identify key orcritical elements of all embodiments nor to delineate the scope of anyor all aspects. Its sole purpose is to present some concepts of one ormore embodiments in a simplified form as a prelude to the more detaileddescription that is presented later. For convenience, the term “someembodiments” may be used herein to refer to a single embodiment ormultiple embodiments of the disclosure.

Certain embodiments disclosed herein include a method for detectingvulnerabilities in base images of software containers. The methodcomprises receiving an event indicating that at least one base imageshould be scanned for vulnerabilities, each base image including atleast one image layer, wherein the event designates at least one sourceof the at least one base image, wherein the least one base imageincludes resources utilized to execute at least a software container;extracting contents of each image layer of each base image; scanning theextracting contents to detect at least one vulnerability; and generatinga detection event, when the at least one vulnerability is detected.

Certain embodiments disclosed herein include a host device for detectingvulnerabilities in software containers at runtime. The host devicecomprises a processing system; and a memory, the memory containinginstructions that, when executed by the processing system, configure thehost device to: receive an event indicating that at least one base imageshould be scanned for vulnerabilities, each base image including atleast one image layer, wherein the event designates at least one sourceof the at least one base image, wherein the least one base imageincludes resources utilized to execute at least a software container;extract contents of each image layer of each base image; scan theextracting contents to detect at least one vulnerability; and generate adetection event, when the at least one vulnerability is detected.

BRIEF DESCRIPTION OF THE DRAWINGS

The subject matter disclosed herein is particularly pointed out anddistinctly claimed in the claims at the conclusion of the specification.The foregoing and other objects, features, and advantages of theinvention will be apparent from the following detailed description takenin conjunction with the accompanying drawings.

FIG. 1 is a diagram illustrating of execution of a plurality of softwarecontainers.

FIG. 2 is a diagram illustrating a structure of a software container.

FIG. 3 is a network diagram utilized to describe the various disclosedembodiments.

FIGS. 4A through 4C show exemplary base images and unitary signaturesgenerated to determine if scanning is required according to anembodiment.

FIG. 5 is a block diagram of a hardware layer in host devices utilizedto execute at least a detector container and a console containeraccording to an embodiment.

FIG. 6 is a flowchart illustrating a method for detectingvulnerabilities in base images software containers according to anembodiment.

FIG. 7 is a flowchart illustrating a method for optimizing thevulnerability detection process according to an embodiment.

DETAILED DESCRIPTION

It is important to note that the embodiments disclosed herein are onlyexamples of the many advantageous uses of the innovative teachingsherein. In general, statements made in the specification of the presentapplication do not necessarily limit any of the various claimedembodiments. Moreover, some statements may apply to some inventivefeatures but not to others. In general, unless otherwise indicated,singular elements may be in plural and vice versa with no loss ofgenerality. In the drawings, like numerals refer to like parts throughseveral views.

By way of example, the various disclosed embodiments include techniquesfor detecting vulnerabilities in base images of software containersprior to runtime. The detected vulnerabilities include at least knownmalwares or zero-day malware. In an embodiment, detection ofvulnerabilities is performed in image registries prior to integration ofa base image in a software container, thereby preventing execution ofsoftware containers that include malicious code embedded in an imagecontainer. In another embodiment, scanning for vulnerabilities isperformed only on images' layers that have not been previously scanned.

FIG. 3 is an example network diagram 300 utilized to describe thevarious embodiments for detection of vulnerabilities in base images ofsoftware containers. The detection of vulnerabilities is performed priorto execution of a software container.

As shown in FIG. 3, a host device 310 is communicably connected to anetwork 320. The host device 310 can be realized as a physical machine,a virtual machine, or a cloud infrastructure (IaaS). Examples for such acloud infrastructure include, but are not limited to, Amazon WebServices (AWS), Cisco® Metapod, Microsoft Azure®, Google® Compute Engine(GCE), Joyent®, and the like. The host device 310 may be deployed in adatacenter, a cloud computing platform (e.g., a public cloud, a privatecloud, or a hybrid cloud), on-premises of an organization, or in acombination thereof. The network 320 may be the Internet, theworld-wide-web (WWW), a local area network (LAN), a wide area network(WAN), a metro area network (MAN), and other networks.

Also connected to the network 320 is one or more image registries 330-1through 330-n (collectively referred to hereinafter as image registries330 or individually as an image registry 330, merely for simplicitypurposes). Each image registry 330 stores base images (not shown) thatcan be accessed or otherwise downloaded to the host device 310. Anexample structure of a base image is shown in FIG. 2. In certainconfigurations, base images can be locally stored at the host device310.

An image registry 330 may be, but is not limited to, Docker Hub, GoogleContainer Registry, Amazon EC2 Container Registry, Artifactory, and thelike. The image registry 330 is a data repository that allows programimages and test them, store manually pushed images, and link to softwarecontainers repositories. An image registry 330 typically provides acentralized resource for discovery, distribution, management, andcollaboration of base images. An image registry 330 may be a cloud-basedregistry service or may be on-premises.

According to the disclosed embodiments, the host device 310 isconfigured to host and execute a detector container 315. The detectorcontainer 315 is a software container designed to detect vulnerabilitiesin any base images stored in the image registry 330 or locally in thehost 310.

In an embodiment, the host device 310 (and the detector container 315)are configured to interface with a continuous integration (CI) system340. Typically, the CI system 340 allows for building, testing, anduploading of an image to the image registry 330. Examples for such a CIsystem 340 include Jenkins®, Appveyor®, TeamCity, Bamboo, and the like.In an example embodiment, the interface between the host device 310 andthe system may be realized as an API or a plugin. The host device 310may be also communicatively connected to a database 350 for storing atleast results from pervious scans.

According to some embodiments, the host device 310 is communicativelyconnected to one or more intelligence systems 360 through the network320. The intelligence systems 360 may include common vulnerabilities andexposures (CVE®) databases, reputation services, security systems(providing feeds on discovered threats), and so on. The informationprovided by the intelligence systems 360 is utilized to detect certainvulnerabilities in the base images stored in the registries 330.

In an optional deployment, the host device 310 may be communicativelyconnected to one or more external systems 370 through the network 320.Examples for such systems 370 may include, but are not limited to, anactive directory of an organization to retrieve user permissions, accesscontrol systems (e.g., Docker Swarm, and Kubernetes management plane),SIEM systems to report on detected vulnerabilities, audit and compliancesystems, and the like.

According to the disclosed embodiments, the detector container 315 isconfigured to receive an event indicating that a base image (not shown)in an image registry 330 has been changed or added. In anotherembodiment, such an event may be received from a CI system 340 when anew image based is created. The event includes at least a source of theimage (e.g., a registry's network address or a check-in system) and anidentifier of the base image to be checked. In some embodiment, theevent be generated by the host device 310 when a new base image isuploaded to the host and/or when an image locally stored in the device310 is modified.

As discussed above, the base image includes a plurality of image layers(e.g., the layers 215, FIG. 2), each of which is uniquely identified. Anidentifier of an image layer may be a check-sum over the contents of thelayer or a hash value computed using a predefined hash function.

In an embodiment, upon receiving an event, it is checked if any layer ofthe base image was previously scanned. If no layer of the base image waspreviously scanned, it is determined that the base image requiresscanning. A base image that requires scanning is exported to the hostdevice 310 (an example for such a base image is shown as 312 in FIG. 3).

In an embodiment, the detector container 315 is configured to reformatthe base image 312 into a data structure that can be processed. Forexample, the data structure may be reformatted to be, but is not limitedto, a file having a standard format, a TAR (Tape ARchive) file, and thelike. In another embodiment, the software container 315 is configured tocreate a container filesystem (e.g., using a Docker platform) for thebase image 312. The filesystem is created without executing the baseimage 312 or the created file system.

Specifically, a software container is created using the base image 312.However, the detector container 315 does not execute any of the binariesthat the base image 312 contains within the newly created softwarecontainer. Rather, the detector container 315 is configured to execute ascanning process for scanning the filesystem and evaluating the securitystate of the based image 312 as discussed herein.

It should be noted that reformatting or creating a filesystem for thebase image 312 includes extracting the structured layers of the baseimage 312. The extracted contents of the base image 312 can be scanned,parsed, or otherwise processed. In an embodiment, when the base image312 is extracted, the software container 315 is configured to startscanning the contents of the base image 312 to detect vulnerabilities.

Specifically, according to some embodiments, the vulnerability scanningincludes the identification of vulnerabilities in at least softwarepackages, software libraries, as well as known and zero-day malwares. Toidentity a vulnerable software package installed within a base image, aversion identifier of each software package is determined. Then, theversion identifier is compared to a list of known vulnerabilitiesassociated with specific package versions. If there is a match, thepackage is determined as vulnerable. For example, an openssl packagewith a version lower than 1.0.1e-2+deb7u5 is known to be vulnerable(CVE-2014-0160 heartbleed vulnerability). Thus, if the base image 312includes such an openssl package, the package is determined to bevulnerable.

To identity a vulnerable software library installed in the base image312, a version identifier of each package is then determined. Then, theversion identifier is compared to a list of known vulnerabilitiesassociated with specific libraries versions. If there is a match, thelibrary is determined as vulnerable. The software libraries may includethird party software libraries, such as public JAR (Java), Gems (Ruby),Python, Node.js, and the like.

The identification of known or zero-day malware is based on the receivedintelligence information from the intelligence system 360. As anexample, the extracted contents of the base image 312 are inspected tocheck a signature of a malware is contained therein. As intelligenceinformation is provided in part from CVE databases, the file scanningprovides a defense against zero-day attacks and vulnerability inreal-time as the files are detected. A malware may include computerviruses, worms, Trojan horses, ransomware, spyware, adware, scareware,and other programs or processes executing malicious code.

Upon detection of a vulnerability, a detection event is generated andreported. Such a detection event may include, but is not limited to, abase image identifier, an infected layer or layers, a source register, atype of the detected vulnerability, and so on. The identifier of amalicious base image is saved in the database 350.

When no vulnerability is detected, the detector container 315 isconfigured to generate a unitary signature for each image layer andpreferably for the entire base image 312. The unitary signature may be acheck-sum of a layer, a hash function computed over the contents of thelayer, and so on. The unitary signatures for each layer are saved in thedatabase 350 to determine if repeated scanning of the base image 312 orany equivalent image is required. In another embodiment, the unitarysignatures are used to determine if repeated scanning of specific layerequivalent to previously scanned layer is required. As layers can beshared among base images, skipping the scanning of previously scannedlayers optimize the detection process.

As noted above, an event indicating that a base image should be scannedmay be received from a CI system 340. According to this embodiment, whena respective base image (e.g., the base image 312) is determined to besafe, the base image is returned to the CI system's pipeline for furtherprocessing. Otherwise, when the base image is malicious, the CI system340 is instructed to stop the integration process.

In an embodiment, when an event indicating that a base image should bescanned is received, the detector container 315 is configured to exportthe base image and to check if there are any unitary signatures saved inthe database 350 for the base image. If so, a unitary signature iscomputed for each layer in the base image requested to be scanned. Thecomputed unitary signatures are matched to those saved in the database350. If the compared unitary signatures are the same, then the baseimage is determined to be safe and is not scanned again. Otherwise, thebase image is scanned as discussed in detailed herein above.

This process is further demonstrated in FIGS. 4A, 4B, and 4C of baseimages 410, 420, and 430 respectively. The base image 410 has beenscanned for vulnerabilities and found safe. The unitary signaturesgenerated for its layers 411 through 414 are “10001000”, “10101010”,11100011”, and “11110000”, respectively. An event indicating that thebase image 420 should be scanned is received. Unitary signatures arecomputed for each of the layers 421 through 424. Such unitary signaturesare “10001000”, “10101010”, 11100011”, and “11110000”, respectively. Theunitary signatures of the layers 421 through 424 are compared to theunitary signatures of the layers 411 through 414, respectively. As thecontents (and thus the signatures) of both images 410 and 420 are thesame, the base image 420 is not scanned, but determined as safe.

An event indicating that the base image 430 should be scanned isreceived. The unitary signatures are computed for each of the layers 431through 434. Such signatures are “10001000”, “10101010”, 11100011”, and“00001111”, respectively. The unitary signatures of layers 431 through434 are compared to the unitary signatures of layers 411 through 414,respectively. As the contents (and thus the signature) of the layer 434are not the same of as those of the layer 414 of the base image 410, thebase image 430 or only the layer in difference (e.g., layer 434) isscanned, or otherwise determined as unsafe.

Returning to back FIG. 3, the embodiments disclosed herein are notlimited to the specific architecture illustrated in FIG. 3 and otherarchitectures may be used without departing from the scope of thedisclosed embodiments. Specifically, in an embodiment, there may be aplurality of detector containers 315 operating as described hereinaboveand configured to either have one as a standby, to share loads betweenthem, or to split the functions between them. In additional, othersoftware containers or processes that handle the management andconfiguration the detector container 315 may be hosted in the device310. Examples for such software containers or processes may include aDocker engine, a networking container, drivers, and so on. In anotherembodiment the detector container 315 may be hosted in the CI system 340or any image register 330.

Furthermore, the detector container 315 can be realized as a softwarecontainer. A software container provides an executable environment witha complete filesystem. A software container may include a micro-service,a Docker container, a light virtual machine, and the like.

It should be appreciated that each the host device 310 requires anunderlying hardware layer to execute the OS, VMs, and softwarecontainers. An example block diagram of a hardware layer 500 is shown inFIG. 5. The hardware layer 500 includes a processing system 510, amemory 515, a storage 520, and a network interface 530, all connected toa computer bus 540.

The processing system 510 may be realized by one or more hardware logiccomponents and circuits. For example, and without limitation,illustrative types of hardware logic components that can be used includeField Programmable Gate Arrays (FPGAs), Application-specific IntegratedCircuits (ASICs), System-on-a-chip systems (SOCs), Complex ProgrammableLogic Devices (CPLDs), general-purpose microprocessors,microcontrollers, digital signal processors (DSPs), and the like, or anyother hardware logic components that can perform calculations or othermanipulations of information. The memory 515 may be volatile,non-volatile, or a combination thereof. The storage 520 may be magneticstorage, optical storage, and the like and

In one configuration, computer readable instructions to implement one ormore embodiments disclosed herein may be stored in the storage 520. Thestorage 520 may also store other computer readable instructions toimplement an operating system, an application program, and the like.Computer readable instructions may be loaded in the memory for executionby the processing system 510.

In another embodiment, the storage 520, the memory 515, or both, areconfigured to store software. Software shall be construed broadly tomean any type of instructions, whether referred to as software,firmware, middleware, microcode, hardware description language, orotherwise. Instructions may include code (e.g., in source code format,binary code format, executable code format, or any other suitable formatof code). The instructions, when executed by the one or more processors,cause the processing system 510 to perform the various functionsdescribed herein with respect to at least detection of vulnerabilities.

The network interface 530 allows communication with other externalsystems or host devices through a network (e.g., the network 320). Thenetwork interface 530 may include a wired connection or a wirelessconnection. The network interface 530 may transmit communication media,receive communication media, or both. The computer bus 540 may be, forexample, a PCIe bus.

FIG. 6 shows an example flowchart 600 illustrating a method fordetection of vulnerabilities in base images of software containersaccording to an embodiment. The detection is performed prior tointegration of a base image in a software container and, therefore,prior to running the software container.

At S610, an event indicating that a base image should be scanned isreceived. Such an event can be received from a continuous integrationsystem, an image registry, and the like. The event may designate aspecific base image or a group of base images (each of which identifiedby their unique identifier) and the source of the image(s) to bescanned. For sake of simplicity of the discussion, the example flowchart600 is discussed with respect to receiving a single event. It should benoted that additional events may be received without departing from thescope of the disclosure.

At S620, the base image to be scanned is exported from its source to thedevice hosting the detector container. It should be emphasized thatexporting the base image does not require executing the image on thehost device.

At S630, the contents of the exported base image are extracted.Specifically, the contents of each layer in the base image may beextracted. In an embodiment, the extraction includes reformatting thebase image into a data structure that can be processed. For example,before reformatting, the data structure may include, but is not limitedto, a file having a standard format (e.g., a TAR file), a filesystemstructure, and the like. In an example embodiment, reformatting the baseimage into a filesystem structure includes creating a containerfilesystem (e.g., using a Docker platform) for the base image 312.

At S640, it is checked if the exported base image should be scanned forvulnerabilities. If so, execution continues with S650; otherwise,execution continues with S690. The operation of S640 is discussed inmore detail with reference to FIG. 7. At S690, a safe event indicatingthat the base image does not contain vulnerabilities is generated. Upongeneration of a safe event, the base image can be safely added to theregistry or to the continuous integration system.

At S650, the extracted contents are scanned for vulnerabilities. Suchvulnerabilities may include previously known or newly discoveredmalware, or any modified version of previously known or newly discoveredmalware. Malware may include, for example, computer viruses, worms,Trojan horses, ransomware, spyware, adware, scareware, and otherprograms or processes executing malicious code.

In an embodiment, the scanning is performed based on intelligenceinformation received from one or more intelligence systems (e.g., theintelligence systems 360). The intelligence information includesdefinitions of known vulnerabilities such as, but not limited to,signatures of viruses or worms, or any viruses, worms, spyware, or anytype of malware. Thus, in an embodiment, the extracted contents of thefile are inspected to determine if the file contains, for example, asignature of a known or newly discovered malware. In another embodiment,the scanning of the extracted contents is further based on one or moreheuristics or behavior patterns of malicious programs. This allows fordetection of known malware in any modified versions.

In an embodiment, S650 further includes scanning for vulnerabilities insoftware packages, libraries, or both, that are installed in the baseimage. To this end, an identifier of each such package or library isdetected in the extracted contents. Each such identifier is comparedagainst a list of vulnerable software packages or libraries. If anypackage or library identifier from the base image matches an identifierin such a list, the base image is determined to be vulnerable.

At S660, it is checked if any vulnerability was detected during thescanning process and, if so, execution continues with S670; otherwise,execution continues with S680.

At S670, a detection event is generated. The detection event may be sentto the source of the base image, i.e., an image registry, a continuousintegration system, or both. The detection event may designate, forexample, a base image identifier, an infected layer or layers, a sourceregister, a type of the detected vulnerability, and so on. Theidentifier of a malicious base image is saved in the database, reportedto an external system, or both. The detection event may cause haltingthe continuous integration or uploaded of the base image.

At S680, when no vulnerability is detected, a unitary signature isgenerated for each image layer and, preferably, for the entire baseimage, and execution continues with S690. The unitary signature may be acheck-sum of a layer, a hash function computed over the contents of thelayer, and so on. The signatures are saved in the database to determineif additional scanning of the base image or any equivalent image isrequired. In an embodiment, S680 may include using the unitarysignatures generated at S640 as described further herein below withrespect to FIG. 7.

FIG. 7 shows an example flowchart S640 illustrating a process fordetermining if a vulnerability scan for an exported base image isrequired according to an embodiment. At S710, a unitary signature isgenerated for each image layer. In an embodiment, a unitary signature isalso generated for the base image. As noted above, a unitary signaturemay be a check-sum of a layer, a hash function computed over thecontents of the layer, and so on.

At S720, if is checked if the unitary signatures generated at S710 matchunitary signatures of a base image or layers that were previouslyscanned for vulnerabilities. As noted above, unitary signatures ofpreviously checked base images are saved in a database, e.g., thedatabase 350. In an embodiment, the generated unitary signatures matchthe unitary signatures of the previously scanned base image if eachgenerated unitary signature matches a corresponding unitary signature ofthe previously scanned base image. In an embodiment, the generatedunitary signature matches the unitary signatures of the previously layerif the corresponding unitary signatures match.

At S730, it is determined if a match was found. If so, at S740, amessage indicating that the exported base image or a specific layer waspreviously scanned is generated and returned. Otherwise, at S750, amessage indicating that the exported base image or a specific layerwithin such image should be scanned is generated and returned.

In an embodiment, the methods discussed with references to FIGS. 6 and 7are performed prior to execution any software container containing thebase images. The methods may be performed by a detector containerexecuted over a host device.

The various embodiments disclosed herein can be implemented as hardware,firmware, software, or any combination thereof. Moreover, the softwareis preferably implemented as an application program tangibly embodied ona program storage unit or computer readable medium consisting of parts,or of certain devices and/or a combination of devices. The applicationprogram may be uploaded to, and executed by, a machine comprising anysuitable architecture. Preferably, the machine is implemented on acomputer platform having hardware such as one or more central processingunits (“CPUs”), a memory, and input/output interfaces. The computerplatform may also include an operating system and microinstruction code.The various processes and functions described herein may be either partof the microinstruction code or part of the application program, or anycombination thereof, which may be executed by a CPU, whether or not sucha computer or processor is explicitly shown. In addition, various otherperipheral units may be connected to the computer platform such as anadditional data storage unit and a printing unit. Furthermore, anon-transitory computer readable medium is any computer readable mediumexcept for a transitory propagating signal.

It should be understood that any reference to an element herein using adesignation such as “first,” “second,” and so forth does not generallylimit the quantity or order of those elements. Rather, thesedesignations are generally used herein as a convenient method ofdistinguishing between two or more elements or instances of an element.Thus, a reference to first and second elements does not mean that onlytwo elements may be employed there or that the first element mustprecede the second element in some manner. Also, unless stated otherwisea set of elements comprises one or more elements. In addition,terminology of the form “at least one of A, B, or C” or “one or more ofA, B, or C” or “at least one of the group consisting of A, B, and C” or“at least one of A, B, and C” used in the description or the claimsmeans “A or B or C or any combination of these elements.” For example,this terminology may include A, or B, or C, or A and B, or A and C, or Aand B and C, or 2A, or 2B, or 2C, and so on.

All examples and conditional language recited herein are intended forpedagogical purposes to aid the reader in understanding the principlesof the disclosed embodiments and the concepts contributed by theinventor to furthering the art, and are to be construed as being withoutlimitation to such specifically recited examples and conditions.Moreover, all statements herein reciting principles, aspects, andembodiments, as well as specific examples thereof, are intended toencompass both structural and functional equivalents thereof.Additionally, it is intended that such equivalents include bothcurrently known equivalents as well as equivalents developed in thefuture, i.e., any elements developed that perform the same function,regardless of structure.

What is claimed is:
 1. A method for detecting vulnerabilities in baseimages of software containers, comprising: receiving an event indicatingthat at least one base image should be scanned for vulnerabilities, eachbase image including at least one image layer, wherein the eventdesignates at least one source of the at least one base image, whereinthe least one base image includes resources utilized to execute at leasta software container; extracting contents of each image layer of the atleast one base image; scanning the extracted contents to detect at leastone vulnerability; generating a detection event, when the at least onevulnerability is detected; generating a unitary signature for each layerof the at least one base image when no vulnerability is detected;determining, after saving the unitary signature in a database, ifrepeated scanning of the at least one base image is required based onthe unitary signature generated for each layer of the at least one baseimage, wherein the contents of each layer are extracted and scannedagain when it is determined that repeated scanning is required; andgenerating a safe event when no vulnerability is detected.
 2. The methodof claim 1, wherein generating the unitary signature for each layer ofthe at least one base image further comprises: computing a check-sumover the contents of each image layer of the at least one base image. 3.The method of claim 1, wherein generating the unitary signature for eachlayer of the at least one base image further comprises: computing ahash-function over the contents of each image layer of the at least onebase image.
 4. The method of claim 1, further comprising: checking ifthe at least one base image was previously scanned based on the unitarysignature generated for each layer of the at least one base image,wherein the contents of each layer are extracted and scanned to detectthe at least one vulnerability for the at least one base image that wasnot previously scanned.
 5. The method of claim 4, wherein checking ifthe at least one base image was previously scanned further comprises:comparing the generated unitary signatures of the least one base imageto unitary signatures of saved scanned layers of base images from thedatabase.
 6. The method of claim 1, further comprising: exporting the atleast one base image from the at least one source to a host device. 7.The method of claim 1, wherein each of the at least one source includesat least one of: a continuous integration system for base images, a hostdevice and an image registry.
 8. The method of claim 1, whereinextracting the contents of each image layer of the at least one baseimage further comprises: reformatting the at least one base image into adata structure.
 9. The method of claim 8, wherein the data structureincludes at least one of: a file having a standard format, and afilesystem structure.
 10. The method of claim 1, wherein the at leastone vulnerability includes at least any one of: malware, a vulnerablesoftware library installed in the at least one base image, and avulnerable software library installed in the at least one base image.11. The method of claim 9, wherein scanning to identify at least malwarefurther comprises: receiving intelligence information, wherein theintelligence information includes at least definitions of malwares; andscanning the extracted contents to identify at least one definition ofthe at least one type of malware defined in the intelligenceinformation.
 12. The method of claim 11, wherein the malware includes atleast one of: previously known malware, and newly discovered malware.13. The method of claim 11, wherein scanning to identify a vulnerablesoftware library installed in the at least one base image furthercomprises: determining an identifier of each software library installedin the at least one base image; and comparing each determined identifieragainst a list of vulnerable software libraries.
 14. The method of claim11, wherein scanning to identify a vulnerable software package installedin the at least one base image further comprises: determining anidentifier of each software package installed in the at least one baseimage; and comparing each determined identifier against a list ofvulnerable software packages.
 15. The method of claim 1, wherein thegenerating the detection event further comprises: halting a process ofupdating the source with the least one base image.
 16. The method ofclaim 1, wherein the detection of vulnerabilities in base images isperformed prior to execution of the at least software container.
 17. Ahost device for detecting vulnerabilities in software containers atruntime, comprising: a processing system; and a memory, the memorycontaining instructions that, when executed by the processing system,configure the host device to: receive an event indicating that at leastone base image should be scanned for vulnerabilities, each base imageincluding at least one image layer, wherein the event designates atleast one source of the at least one base image, wherein the least onebase image includes resources utilized to execute at least a softwarecontainer; extract contents of each image layer of the at least one baseimage; scan the extracted contents to detect at least one vulnerability;generate a detection event, when the at least one vulnerability isdetected; and generate a unitary signature for each layer of the atleast one base image when no vulnerability is detected; determine, aftersaving the unitary signature in a database, if repeated scanning of theat least one base image is required based on the unitary signaturegenerated for each layer of the at least one base image, wherein thecontents of each layer are extracted and scanned again when it isdetermined that repeated scanning is required; and generate a safe eventwhen no vulnerability is detected.
 18. The host device of claim 17,wherein the host device is further configured to: compute a check-sumover the contents of each image layer of the each base image.
 19. Thehost device of claim 17, wherein the host device is further configuredto: compute a hash-function over the contents of each image layer of theeach base image.
 20. The host device of claim 17, wherein the hostdevice is further configured to: check if the at least one base imagewas previously scanned based on the unitary signature generated for eachlayer of the each base image, wherein the contents of each layer areextracted and scanned to detect the at least one vulnerability for theat least one base image that was not previously scanned.
 21. The hostdevice of claim 20, wherein the host device is further configured to:compare the generated unitary signatures of the least one base image tounitary signatures of saved scanned image layers of base images from thedatabase.
 22. The host device of claim 17, wherein the host device isfurther configured to: export the at least one base image from the atleast one source to the host device.
 23. The host device of claim 17,wherein the at least one source includes at least one of: a continuousintegration system for base images, the host device and an imageregistry.
 24. The host device of claim 17, wherein the host device isfurther configured to: reformat the at least one base image into a datastructure.
 25. The host device of claim 24, wherein the data structureincludes at least one of: a file having a standard format, and afilesystem structure.
 26. The host device of claim 17, wherein the atleast one vulnerability includes at least any one of: malware, avulnerable software library installed in the at least one base image,and a vulnerable software library installed in the at least one baseimage.
 27. The host device of claim 26, wherein the host device isfurther configured to: receive intelligence information, wherein theintelligence information includes at least definitions of malwares; andscan the extracted contents to identify at least one definition of theat least one type of malware defined in the intelligence information.28. The host device of claim 18, wherein the malware includes at leastone of: previously known malware, and newly discovered malware.
 29. Thehost device of claim 18, wherein the host device is further configuredto: determine an identifier of each software library installed in the atleast one base image; and compare each determined identifier against alist of vulnerable software libraries.
 30. The host device of claim 29,wherein the host device is further configured to: determine anidentifier of each software package installed in the at least one baseimage; and compare each determined identifier against a list ofvulnerable software packages.
 31. The host device of claim 17, whereinthe host device is further configured to: halt a process of updating thesource with the least one base image.
 32. The host device of claim 17,wherein the detection of vulnerabilities in base images is performedprior to execution of the at least software container.
 33. Anon-transitory computer readable medium having stored thereoninstructions for causing a processing system to execute a process fordetecting vulnerabilities in software containers at runtime, the processcomprising: receiving an event indicating that at least one base imageshould be scanned for vulnerabilities, each base image including atleast one image layer, wherein the event designates at least one sourceof the at least one base image, wherein the least one base imageincludes resources utilized to execute at least a software container;extracting contents of each image layer of the at least one base image;scanning the extracted contents to detect at least one vulnerability;generating a detection event, when the at least one vulnerability isdetected; generating a unitary signature for each layer of the at leastone base image when no vulnerability is detected; determining, aftersaving the unitary signature in a database, if repeated scanning of theat least one base image is required based on the unitary signaturegenerated for each layer of the at least one base image, wherein thecontents of each layer are extracted and scanned again when it isdetermined that repeated scanning is required; and generating a safeevent when no vulnerability is detected.